package com.example.demo.service;

import com.example.demo.domain.Commodity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;

import java.util.List;

public interface CommodityService  {
    long count();

    Commodity save(Commodity commodity);

    void delete(Commodity commodity);

    Iterable<Commodity> getAll();

    List<Commodity> getByName(String name);

    Page<Commodity> pageQuery(Integer pageNo, Integer pageSize, String kw);

    List<Commodity> divideWordsQuery(@PageableDefault(page = 0, value = 2) Pageable pageable, String kw);
}
